<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03demo</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    {{num}}
    <button v-on:click="ja">+</button>
    <button v-on:click="ji">-</button>
</div>
<script type="text/javascript">
    var app = new Vue({
        el:"#app",
        data:{
            num: 0,
        },
        created() {
            console.log("created hook")
        },
        methods:{
            ji(){
                this.num--
            },
            ja(){
                this.num++
            }
        }
    })
</script>

</body>
</html>